<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h3>注册</h3>
    <div class="input-info-item">
        用户名
        <input id="user" name="username" type="text" />
    </div>
    <div class="input-info-item">
        手机号
        <input id="phone" name="phone" type="number" />
    </div>
    <div class="input-info-item">
        密码
        <input id="pswd" name="password" type="password" />
    </div>
    <div id="registryPost">注册表</div>
    <p id="msg" style="color: blueviolet;"></p>
</body>

</html>
<script src="./component/request.js"></script>
<script src="./component/api.js"></script>

<script>
    const registryPost = document.getElementById('registryPost')
    registryPost.onclick = function () {
        const user = document.getElementById('user').value;
        const pswd = document.getElementById('pswd').value;
        const phone = document.getElementById('phone').value;
        console.log('注册');
        API_RegisterPost(user, phone, pswd, (res) => {
            if (res.code === 0) {

            }
            document.getElementById('msg').innerText = res.msg;
        });
    }
</script>